using System;
using Tencent;
namespace Senparc.Weixin.QY
{
	public static class Signature
	{
		public const string Token = "weixin";
		public const string EncodingAESKey = "8eKaVU1Ei6M3c3kGY21LKNObvepQuIyQLCLKIt5Zc8u";
		public const string CorpId = "Senparc";
		public static string GenarateSinature(string token, string timeStamp, string nonce, string msgEncrypt)
		{
			string result = null;
			int num = WXBizMsgCrypt.GenarateSinature(token, timeStamp, nonce, msgEncrypt, ref result);
			if (num != 0)
			{
				return num.ToString();
			}
			return result;
		}
		public static string VerifyURL(string token, string encodingAESKey, string corpId, string msgSignature, string timeStamp, string nonce, string echoStr)
		{
			WXBizMsgCrypt wXBizMsgCrypt = new WXBizMsgCrypt(token, encodingAESKey, corpId);
			string result = null;
			if (wXBizMsgCrypt.VerifyURL(msgSignature, timeStamp, nonce, echoStr, ref result) == 0)
			{
				return result;
			}
			return null;
		}
		public static string EncryptMsg(string token, string encodingAESKey, string corpId, string replyMsg, string timeStamp, string nonce)
		{
			WXBizMsgCrypt wXBizMsgCrypt = new WXBizMsgCrypt(token, encodingAESKey, corpId);
			string result = null;
			wXBizMsgCrypt.EncryptMsg(replyMsg, timeStamp, nonce, ref result);
			return result;
		}
	}
}
